package test;

import java.io.File;
import java.nio.file.Files;
import java.util.Collections;
import java.util.LinkedList;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileMulu {
    public static void main(String[] args) {
        File f=new File("F:\\hlwjgs5.0");
        LinkedList<File> files =new LinkedList<>();
        files.add(f);
        int size=0;
        while (files.size()!=0){
            File t = files.removeFirst();
            size++;
            System.out.println(t.getAbsolutePath());
            if(!t.canRead())
                continue;
            if(t.isDirectory()){
                File[] fr = t.listFiles();
                Collections.addAll(files,fr);
            }
        }
        System.out.println("size:"+size);

        //Files.
    }
}
